Added documentation about how to use the unit test runner.
[adiumx.git] / Plugins / Purple Service / CBPurpleAccount.h
blobf1c47fc4ba6adf2b09bc6039bc8d070253560c65
1 /*
2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
4 *
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #import <Adium/AIAccount.h>
18 #import <AdiumLibpurple/PurpleCommon.h>
20 @class SLPurpleCocoaAdapter, ESFileTransfer, AIService, AIContentMessage, AIStatus, AIWindowController;
21 @protocol AIAccountControllerRemoveConfirmationDialog;
23 @interface CBPurpleAccount : AIAccount <AIAccount_Privacy>
25 PurpleAccount *account;
27 NSMutableDictionary *customEmoticonWaitingDict;
29 NSMutableArray *permittedContactsArray;
30 NSMutableArray *deniedContactsArray;
32 NSDictionary *tuneinfo;
33 BOOL willBeDeleted;
34 id<AIAccountControllerRemoveConfirmationDialog> deletionDialog;
37 - (const char*)protocolPlugin;
38 - (PurpleAccount*)purpleAccount;
39 - (const char *)purpleAccountName;
41 - (void)createNewPurpleAccount;
43 - (void)dealloc;
44 - (NSSet *)supportedPropertyKeys;
45 - (void)updateStatusForKey:(NSString *)key;
46 - (NSDictionary *)defaultProperties;
47 - (NSString *)unknownGroupName;
48 - (BOOL)useDisplayNameAsStatusMessage;
49 - (AIService *)_serviceForUID:(NSString *)contactUID;
50 - (void)unregisteredAccount:(BOOL)success;
52 /* CBPurpleAccount odes not implement AIAccount_Files; however, all subclasses which do use the same code.
53 The superclass therefore has the code and declares the methods here. */
54 //Instructs the account to accept a file transfer request
55 - (void)acceptFileTransferRequest:(ESFileTransfer *)fileTransfer;
56 //Instructs the account to reject a file receive request
57 - (void)rejectFileReceiveRequest:(ESFileTransfer *)fileTransfer;
58 //Instructs the account to cancel a file transfer in progress
59 - (void)cancelFileTransfer:(ESFileTransfer *)fileTransfer;
61 //Private (for subclasses only) file transfer methods
62 - (PurpleXfer *)newOutgoingXferForFileTransfer:(ESFileTransfer *)fileTransfer;
63 - (void)_beginSendOfFileTransfer:(ESFileTransfer *)fileTransfer;
65 //AIAccount_Privacy
66 -(BOOL)addListObject:(AIListObject *)inObject toPrivacyList:(AIPrivacyType)type;
67 -(BOOL)removeListObject:(AIListObject *)inObject fromPrivacyList:(AIPrivacyType)type;
68 -(NSArray *)listObjectsOnPrivacyList:(AIPrivacyType)type;
70 //Connectivity
71 - (void)connect;
72 - (void)configureAccountProxyNotifyingTarget:(id)target selector:(SEL)selector;
73 - (void)disconnect;
74 - (NSString *)connectionStringForStep:(int)step;
75 - (void)configurePurpleAccount;
77 //Account status
78 - (NSSet *)supportedPropertyKeys;
79 - (void)updateStatusForKey:(NSString *)key;
80 - (void)setAccountUserImageData:(NSData *)originalData;
81 - (void)setAccountIdleSinceTo:(NSDate *)idleSince;
83 - (void)setStatusState:(AIStatus *)statusState statusID:(const char *)statusID isActive:(NSNumber *)isActive arguments:(NSMutableDictionary *)arguments;
84 - (const char *)purpleStatusIDForStatus:(AIStatus *)statusState
85 arguments:(NSMutableDictionary *)arguments;
87 - (void)setAccountProfileTo:(NSAttributedString *)profile;
89 - (BOOL)shouldSetAliasesServerside;
91 - (SLPurpleCocoaAdapter *)purpleThread;
93 #pragma mark Purple callback handling methods
94 - (void)accountConnectionConnected;
95 - (void)accountConnectionReportDisconnect:(NSString *)text;
96 - (void)accountConnectionNotice:(NSString *)text;
97 - (void)accountConnectionDisconnected;
98 - (void)accountConnectionProgressStep:(NSNumber *)step percentDone:(NSNumber *)connectionProgressPrecent;
99 - (void)accountConnectionStep:(NSString*)msg step:(int)step totalSteps:(int)step_count;
101 - (void)newContact:(AIListContact *)theContact withName:(NSString *)inName;
102 - (void)updateContact:(AIListContact *)theContact
103 toGroupName:(NSString *)groupName
104 contactName:(NSString *)contactName;
105 - (void)updateContact:(AIListContact *)theContact toAlias:(NSString *)purpleAlias;
106 - (void)updateContact:(AIListContact *)theContact forEvent:(NSNumber *)event;
107 - (void)updateSignon:(AIListContact *)theContact withData:(void *)data;
108 - (void)updateSignoff:(AIListContact *)theContact withData:(void *)data;
109 - (void)updateSignonTime:(AIListContact *)theContact withData:(NSDate *)signonDate;
110 - (void)updateStatusForContact:(AIListContact *)theContact
111 toStatusType:(NSNumber *)statusTypeNumber
112 statusName:(NSString *)statusName
113 statusMessage:(NSAttributedString *)statusMessage;
114 - (NSString *)statusNameForPurpleBuddy:(PurpleBuddy *)b;
115 - (NSAttributedString *)statusMessageForPurpleBuddy:(PurpleBuddy *)b;
116 - (void)updateEvil:(AIListContact *)theContact withData:(NSNumber *)evilNumber;
117 - (void)updateIcon:(AIListContact *)theContact withData:(NSData *)userIconData;
118 - (void)updateMobileStatus:(AIListContact *)theContact withData:(BOOL)isMobile;
120 - (void)removeContact:(AIListContact *)theContact;
122 - (id)authorizationRequestWithDict:(NSDictionary*)dict;
124 - (void)addChat:(AIChat *)chat;
125 - (void)typingUpdateForIMChat:(AIChat *)chat typing:(NSNumber *)typing;
126 - (void)updateForChat:(AIChat *)chat type:(NSNumber *)type;
127 - (AIChat *)chatWithContact:(AIListContact *)contact identifier:(id)identifier;
129 - (void)receivedIMChatMessage:(NSDictionary *)messageDict inChat:(AIChat *)chat;
130 - (void)receivedMultiChatMessage:(NSDictionary *)messageDict inChat:(AIChat *)chat;
131 - (void)removeUser:(NSString *)contactName fromChat:(AIChat *)chat;
133 - (void)requestReceiveOfFileTransfer:(ESFileTransfer *)fileTransfer;
134 - (void)updateProgressForFileTransfer:(ESFileTransfer *)fileTransfer
135 percent:(NSNumber *)percent
136 bytesSent:(NSNumber *)bytesSent;
137 - (void)fileTransferCancelledRemotely:(ESFileTransfer *)fileTransfer;
138 - (void)fileTransferCancelledLocally:(ESFileTransfer *)fileTransfer;
139 - (void)destroyFileTransfer:(ESFileTransfer *)fileTransfer;
140 - (ESFileTransfer *)newFileTransferObjectWith:(NSString *)destinationUID
141 size:(unsigned long long)inSize
142 remoteFilename:(NSString *)remoteFilename;
144 - (BOOL)allowFileTransferWithListObject:(AIListObject *)inListObject;
145 - (BOOL)canSendFolders;
147 - (AIChat *)chatWithName:(NSString *)name identifier:(id)identifier;
148 - (void)requestAddContactWithUID:(NSString *)contactUID;
150 - (void)gotGroupForContact:(AIListContact *)contact;
152 - (NSString *)encodedAttributedString:(NSAttributedString *)inAttributedString
153 forStatusState:(AIStatus *)statusState;
154 - (BOOL)inviteContact:(AIListContact *)contact toChat:(AIChat *)chat withMessage:(NSString *)inviteMessage;
156 - (NSString *)titleForContactMenuLabel:(const char *)label forContact:(AIListContact *)inContact;
157 - (NSString *)titleForAccountActionMenuLabel:(const char *)label;
159 - (NSString *)_UIDForAddingObject:(AIListContact *)object;
161 #pragma mark Contacts
162 - (void)renameContact:(AIListContact *)theContact toUID:(NSString *)newUID;
163 - (void)updateWentIdle:(AIListContact *)theContact withData:(NSDate *)idleSinceDate;
164 - (void)updateIdleReturn:(AIListContact *)theContact withData:(void *)data;
165 - (void)updateUserInfo:(AIListContact *)theContact withData:(PurpleNotifyUserInfo *)user_info;
167 #pragma mark Chats
168 - (void)errorForChat:(AIChat *)chat type:(NSNumber *)type;
169 - (void)removeUsersArray:(NSArray *)usersArray fromChat:(AIChat *)chat;
170 - (void)updateTopic:(NSString *)inTopic forChat:(AIChat *)chat;
171 - (void)updateTitle:(NSString *)inTitle forChat:(AIChat *)chat;
172 - (void)convUpdateForChat:(AIChat *)chat type:(NSNumber *)type;
173 - (void)addUsersArray:(NSArray *)usersArray
174 withFlags:(NSArray *)flagsArray
175 andAliases:(NSArray *)aliasesArray
176 newArrivals:(NSNumber *)newArrivals
177 toChat:(AIChat *)chat;
179 #pragma mark Privacy
180 - (void)privacyPermitListAdded:(NSString *)sourceUID;
181 - (void)privacyDenyListAdded:(NSString *)sourceUID;
182 - (void)privacyPermitListRemoved:(NSString *)sourceUID;
183 - (void)privacyDenyListRemoved:(NSString *)sourceUID;
185 #pragma mark Emoticons
186 - (void)chat:(AIChat *)inChat isWaitingOnCustomEmoticon:(NSString *)isWaiting;
187 - (void)chat:(AIChat *)inChat setCustomEmoticon:(NSString *)emoticonEquivalent withImageData:(NSData *)inImageData;
188 - (void)chat:(AIChat *)inChat closedCustomEmoticon:(NSString *)inEmoticon;
190 #pragma mark Room Commands
191 -(void)doCommand:(id)sender;
192 -(void)executeCommandWithParameters:(NSMutableDictionary*)parameters;
194 @end